/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.shop.service.product;

import java.util.List;

import com.thinkgem.jeesite.modules.hk.shop.entity.product.HkShopProduct;
import com.thinkgem.jeesite.modules.hk.shop.entity.product.HkShopProductColor;
import com.thinkgem.jeesite.modules.hk.shop.entity.product.HkShopProductSku;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.hk.shop.entity.product.HkShopProductSkuImages;
import com.thinkgem.jeesite.modules.hk.shop.dao.product.HkShopProductSkuImagesDao;

/**
 * 乐购产品sku图片Service
 * @author 罗天文
 * @version 2018-05-15
 */
@Service
@Transactional(readOnly = true)
public class HkShopProductSkuImagesService extends CrudService<HkShopProductSkuImagesDao, HkShopProductSkuImages> {

	public HkShopProductSkuImages get(String id) {
		return super.get(id);
	}
	
	public List<HkShopProductSkuImages> findList(HkShopProductSkuImages hkShopProductSkuImages) {
		return super.findList(hkShopProductSkuImages);
	}
	
	public Page<HkShopProductSkuImages> findPage(Page<HkShopProductSkuImages> page, HkShopProductSkuImages hkShopProductSkuImages) {
		return super.findPage(page, hkShopProductSkuImages);
	}
	
	@Transactional(readOnly = false)
	public void save(HkShopProductSkuImages hkShopProductSkuImages) {
		super.save(hkShopProductSkuImages);
	}
	
	@Transactional(readOnly = false)
	public void delete(HkShopProductSkuImages hkShopProductSkuImages) {
		super.delete(hkShopProductSkuImages);
	}


	public void deleteByProductColor(HkShopProduct id, String c) {
		HkShopProductSkuImages hkShopProductSkuImages=new HkShopProductSkuImages();
		hkShopProductSkuImages.setProduct(id);
		hkShopProductSkuImages.setProductColor(new HkShopProductColor(c));
		dao.deleteByProductColor(hkShopProductSkuImages);

	}
}